package edu.sctu.practice.class02.lvchang.assign03.test3;

/**
 * Created by Administrator on 2015/10/27.
 */
public class RunMain {

    public static void main(String[] args) {

        CloneableCircle cloneableCircle = new CloneableCircle(2.3);
        CloneableCircle cloneableCircle1 = (CloneableCircle) cloneableCircle.clone();

        System.out.println("将 cloneableCircle 复制到 cloneableCircle1 后:");


        if (cloneableCircle == cloneableCircle1)
            System.out.println("cloneableCircle cloneableCircle1引用同一个对象");
        else
            System.out.println("cloneableCircle cloneableCircle1不指向同一个对象");


        if (cloneableCircle.equals(cloneableCircle1))
            System.out.println("cloneableCircle cloneableCircle1有相同的内容");
        else
            System.out.println("cloneableCircle cloneableCircle1有不相同的内容");


        System.out.println("\n修改了 cloneableCircle 之后：");
        System.out.println("cloneableCircle ：" + cloneableCircle);
        System.out.println("cloneableCircle1 ：" + cloneableCircle1);

        System.out.println();
        if (cloneableCircle instanceof Cloneable) {
            System.out.println("A CloneableCircle object is cloneable");
        } else {
            System.out.println("A CloneableCircle object is not cloneable");
        }

        System.out.println();
        Circle c = new Circle(2.3);
        if (c instanceof Cloneable) {
            System.out.println("A Circle object is cloneable");
        } else {
            System.out.println("A Circle object is not cloneable");
        }
    }
}

